<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: faiss::OnDiskInvertedLists Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefaiss.html">faiss</a></li><li class="navelem"><a class="el" href="structfaiss_1_1OnDiskInvertedLists.html">OnDiskInvertedLists</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="structfaiss_1_1OnDiskInvertedLists-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">faiss::OnDiskInvertedLists Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="OnDiskInvertedLists_8h_source.html">OnDiskInvertedLists.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for faiss::OnDiskInvertedLists:</div>
<div class="dyncontent">
 <div class="center">
  <img src="structfaiss_1_1OnDiskInvertedLists.png" usemap="#faiss::OnDiskInvertedLists_map" alt=""/>
  <map id="faiss::OnDiskInvertedLists_map" name="faiss::OnDiskInvertedLists_map">
<area href="structfaiss_1_1InvertedLists.html" alt="faiss::InvertedLists" shape="rect" coords="0,0,156,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists_1_1List.html">List</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists_1_1OngoingPrefetch.html">OngoingPrefetch</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists_1_1Slot.html">Slot</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:acce006c1c63aee12d45c7f7dbeb8bb23"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acce006c1c63aee12d45c7f7dbeb8bb23"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists.html#acce006c1c63aee12d45c7f7dbeb8bb23">OnDiskInvertedLists</a> (size_t <a class="el" href="structfaiss_1_1InvertedLists.html#afaf8b7aa3e846aa4553f6aae67827ec8">nlist</a>, size_t <a class="el" href="structfaiss_1_1InvertedLists.html#ae06049e4259edb47d443ef87bdedc744">code_size</a>, const char *filename)</td></tr>
<tr class="memdesc:acce006c1c63aee12d45c7f7dbeb8bb23"><td class="mdescLeft">&#160;</td><td class="mdescRight">are inverted lists mapped read-only <br/></td></tr>
<tr class="separator:acce006c1c63aee12d45c7f7dbeb8bb23"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19b264dfe5a541c1427d3b635ad887f5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a19b264dfe5a541c1427d3b635ad887f5"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists.html#a19b264dfe5a541c1427d3b635ad887f5">list_size</a> (size_t list_no) const override</td></tr>
<tr class="memdesc:a19b264dfe5a541c1427d3b635ad887f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the size of a list <br/></td></tr>
<tr class="separator:a19b264dfe5a541c1427d3b635ad887f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1695e1d8d64a00e8e5f57ebf2210cb87"><td class="memItemLeft" align="right" valign="top">const uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists.html#a1695e1d8d64a00e8e5f57ebf2210cb87">get_codes</a> (size_t list_no) const override</td></tr>
<tr class="separator:a1695e1d8d64a00e8e5f57ebf2210cb87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae54e7c6abc10c3d59ea3cd1113466957"><td class="memItemLeft" align="right" valign="top">const idx_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists.html#ae54e7c6abc10c3d59ea3cd1113466957">get_ids</a> (size_t list_no) const override</td></tr>
<tr class="separator:ae54e7c6abc10c3d59ea3cd1113466957"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a762cfcc06fe60dbaa807ce72723531a9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a762cfcc06fe60dbaa807ce72723531a9"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>add_entries</b> (size_t list_no, size_t n_entry, const idx_t *ids, const uint8_t *code) override</td></tr>
<tr class="separator:a762cfcc06fe60dbaa807ce72723531a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d64d34d7ce9b242bb840c218fc3059c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d64d34d7ce9b242bb840c218fc3059c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>update_entries</b> (size_t list_no, size_t offset, size_t n_entry, const idx_t *ids, const uint8_t *code) override</td></tr>
<tr class="separator:a4d64d34d7ce9b242bb840c218fc3059c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b2faf11aea3dcb1dbf07a52af33099b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6b2faf11aea3dcb1dbf07a52af33099b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>resize</b> (size_t list_no, size_t new_size) override</td></tr>
<tr class="separator:a6b2faf11aea3dcb1dbf07a52af33099b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a1a4be6c5eaad253900d5a690cf7cf7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5a1a4be6c5eaad253900d5a690cf7cf7"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>merge_from</b> (const <a class="el" href="structfaiss_1_1InvertedLists.html">InvertedLists</a> **ils, int n_il)</td></tr>
<tr class="separator:a5a1a4be6c5eaad253900d5a690cf7cf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed1cdb979275ec1e6ab8f0c7fead60c7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1OnDiskInvertedLists.html#aed1cdb979275ec1e6ab8f0c7fead60c7">prefetch_lists</a> (const long *list_nos, int <a class="el" href="structfaiss_1_1InvertedLists.html#afaf8b7aa3e846aa4553f6aae67827ec8">nlist</a>) const override</td></tr>
<tr class="separator:aed1cdb979275ec1e6ab8f0c7fead60c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afbdee1f61b80b7748028fa95d3d09a6b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afbdee1f61b80b7748028fa95d3d09a6b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>do_mmap</b> ()</td></tr>
<tr class="separator:afbdee1f61b80b7748028fa95d3d09a6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11bf6949899bc7f11be17322dec68ee5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11bf6949899bc7f11be17322dec68ee5"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>update_totsize</b> (size_t new_totsize)</td></tr>
<tr class="separator:a11bf6949899bc7f11be17322dec68ee5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48854bce4aa01698b5b3fb0d636caac0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48854bce4aa01698b5b3fb0d636caac0"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>resize_locked</b> (size_t list_no, size_t new_size)</td></tr>
<tr class="separator:a48854bce4aa01698b5b3fb0d636caac0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f351c2423c5f87f61241eb7df8d50f0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f351c2423c5f87f61241eb7df8d50f0"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>allocate_slot</b> (size_t capacity)</td></tr>
<tr class="separator:a8f351c2423c5f87f61241eb7df8d50f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27fc559dcc2e48a7dded1a99540cb22a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a27fc559dcc2e48a7dded1a99540cb22a"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>free_slot</b> (size_t offset, size_t capacity)</td></tr>
<tr class="separator:a27fc559dcc2e48a7dded1a99540cb22a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_structfaiss_1_1InvertedLists"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_structfaiss_1_1InvertedLists')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="structfaiss_1_1InvertedLists.html">faiss::InvertedLists</a></td></tr>
<tr class="memitem:a83d053d03720d938dc4fc4e2f674619c inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83d053d03720d938dc4fc4e2f674619c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>InvertedLists</b> (size_t <a class="el" href="structfaiss_1_1InvertedLists.html#afaf8b7aa3e846aa4553f6aae67827ec8">nlist</a>, size_t <a class="el" href="structfaiss_1_1InvertedLists.html#ae06049e4259edb47d443ef87bdedc744">code_size</a>)</td></tr>
<tr class="separator:a83d053d03720d938dc4fc4e2f674619c inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a21b52cdb0601cd225bd7924932310876 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top">virtual idx_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1InvertedLists.html#a21b52cdb0601cd225bd7924932310876">get_single_id</a> (size_t list_no, size_t offset) const </td></tr>
<tr class="separator:a21b52cdb0601cd225bd7924932310876 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afc2760bed7c210f2fad9b03109f561ee inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top">virtual const uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1InvertedLists.html#afc2760bed7c210f2fad9b03109f561ee">get_single_code</a> (size_t list_no, size_t offset) const </td></tr>
<tr class="separator:afc2760bed7c210f2fad9b03109f561ee inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd3e36cc06fc49e02773e403a84dba95 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acd3e36cc06fc49e02773e403a84dba95"></a>
virtual size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1InvertedLists.html#acd3e36cc06fc49e02773e403a84dba95">add_entry</a> (size_t list_no, idx_t theid, const uint8_t *code)</td></tr>
<tr class="memdesc:acd3e36cc06fc49e02773e403a84dba95 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="mdescLeft">&#160;</td><td class="mdescRight">add one entry to an inverted list <br/></td></tr>
<tr class="separator:acd3e36cc06fc49e02773e403a84dba95 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57e1382949b91f77acc46790b6431056 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a57e1382949b91f77acc46790b6431056"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>update_entry</b> (size_t list_no, size_t offset, idx_t id, const uint8_t *code)</td></tr>
<tr class="separator:a57e1382949b91f77acc46790b6431056 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72e736253a669dad5f6e5188168e5c60 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a72e736253a669dad5f6e5188168e5c60"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>reset</b> ()</td></tr>
<tr class="separator:a72e736253a669dad5f6e5188168e5c60 inherit pub_methods_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a96715d36dae381fc45204f091198d932"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a96715d36dae381fc45204f091198d932"></a>
std::vector&lt; <a class="el" href="structfaiss_1_1OnDiskInvertedLists_1_1List.html">List</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>lists</b></td></tr>
<tr class="separator:a96715d36dae381fc45204f091198d932"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb138d838eeb3c732a8cf0b460f051a0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acb138d838eeb3c732a8cf0b460f051a0"></a>
std::list&lt; <a class="el" href="structfaiss_1_1OnDiskInvertedLists_1_1Slot.html">Slot</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>slots</b></td></tr>
<tr class="separator:acb138d838eeb3c732a8cf0b460f051a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a6b94bbf12d81248cf3a093d8dddee0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9a6b94bbf12d81248cf3a093d8dddee0"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>filename</b></td></tr>
<tr class="separator:a9a6b94bbf12d81248cf3a093d8dddee0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85ad4a6336e9593450aa555ea598194c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a85ad4a6336e9593450aa555ea598194c"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>totsize</b></td></tr>
<tr class="separator:a85ad4a6336e9593450aa555ea598194c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0adc16674053bb53b34b284f0a9c02a6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0adc16674053bb53b34b284f0a9c02a6"></a>
uint8_t *&#160;</td><td class="memItemRight" valign="bottom"><b>ptr</b></td></tr>
<tr class="separator:a0adc16674053bb53b34b284f0a9c02a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accf9f3461466233fa612402437d0e5ff"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="accf9f3461466233fa612402437d0e5ff"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>read_only</b></td></tr>
<tr class="separator:accf9f3461466233fa612402437d0e5ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebd05c108fe85af4b095dad8e8915421"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aebd05c108fe85af4b095dad8e8915421"></a>
<a class="el" href="structfaiss_1_1LockLevels.html">LockLevels</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>locks</b></td></tr>
<tr class="separator:aebd05c108fe85af4b095dad8e8915421"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93eb0db0f7b9774061e956ef20f46550"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a93eb0db0f7b9774061e956ef20f46550"></a>
<a class="el" href="structfaiss_1_1OnDiskInvertedLists_1_1OngoingPrefetch.html">OngoingPrefetch</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>pf</b></td></tr>
<tr class="separator:a93eb0db0f7b9774061e956ef20f46550"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_structfaiss_1_1InvertedLists"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_structfaiss_1_1InvertedLists')"><img src="closed.png" alt="-"/>&#160;Public Attributes inherited from <a class="el" href="structfaiss_1_1InvertedLists.html">faiss::InvertedLists</a></td></tr>
<tr class="memitem:afaf8b7aa3e846aa4553f6aae67827ec8 inherit pub_attribs_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afaf8b7aa3e846aa4553f6aae67827ec8"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1InvertedLists.html#afaf8b7aa3e846aa4553f6aae67827ec8">nlist</a></td></tr>
<tr class="memdesc:afaf8b7aa3e846aa4553f6aae67827ec8 inherit pub_attribs_structfaiss_1_1InvertedLists"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of possible key values <br/></td></tr>
<tr class="separator:afaf8b7aa3e846aa4553f6aae67827ec8 inherit pub_attribs_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae06049e4259edb47d443ef87bdedc744 inherit pub_attribs_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae06049e4259edb47d443ef87bdedc744"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfaiss_1_1InvertedLists.html#ae06049e4259edb47d443ef87bdedc744">code_size</a></td></tr>
<tr class="memdesc:ae06049e4259edb47d443ef87bdedc744 inherit pub_attribs_structfaiss_1_1InvertedLists"><td class="mdescLeft">&#160;</td><td class="mdescRight">code size per vector in bytes <br/></td></tr>
<tr class="separator:ae06049e4259edb47d443ef87bdedc744 inherit pub_attribs_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_structfaiss_1_1InvertedLists"><td colspan="2" onclick="javascript:toggleInherit('pub_types_structfaiss_1_1InvertedLists')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="structfaiss_1_1InvertedLists.html">faiss::InvertedLists</a></td></tr>
<tr class="memitem:a2bb406f72dcad45cf03974ff14bfa473 inherit pub_types_structfaiss_1_1InvertedLists"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2bb406f72dcad45cf03974ff14bfa473"></a>
typedef <a class="el" href="structfaiss_1_1Index.html#a040c6aed1f224f3ea7bf58eebc0c31a4">Index::idx_t</a>&#160;</td><td class="memItemRight" valign="bottom"><b>idx_t</b></td></tr>
<tr class="separator:a2bb406f72dcad45cf03974ff14bfa473 inherit pub_types_structfaiss_1_1InvertedLists"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>On-disk storage of inverted lists.</p>
<p>The data is stored in a mmapped chunk of memory (base ptointer ptr, size totsize). Each list is a range of memory that contains (object <a class="el" href="structfaiss_1_1OnDiskInvertedLists_1_1List.html">List</a>) that contains:</p>
<ul>
<li>uint8_t codes[capacity * code_size]</li>
<li>followed by idx_t ids[capacity]</li>
</ul>
<p>in each of the arrays, the size &lt;= capacity first elements are used, the rest is not initialized.</p>
<p>Addition and resize are supported by:</p>
<ul>
<li>roundind up the capacity of the lists to a power of two</li>
<li>maintaining a list of empty slots, sorted by size.</li>
<li>resizing the mmapped block is adjusted as needed.</li>
</ul>
<p>An <a class="el" href="structfaiss_1_1OnDiskInvertedLists.html">OnDiskInvertedLists</a> is compact if the size == capacity for all lists and there are no available slots.</p>
<p>Addition to the invlists is slow. For incremental add it is better to use a default <a class="el" href="structfaiss_1_1ArrayInvertedLists.html">ArrayInvertedLists</a> object and convert it to an OnDisk with merge_from.</p>
<p>When it is known that a set of lists will be accessed, it is useful to call prefetch_lists, that launches a set of threads to read the lists in parallel. </p>

<p>Definition at line <a class="el" href="OnDiskInvertedLists_8h_source.html#l00052">52</a> of file <a class="el" href="OnDiskInvertedLists_8h_source.html">OnDiskInvertedLists.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a1695e1d8d64a00e8e5f57ebf2210cb87"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const uint8_t * faiss::OnDiskInvertedLists::get_codes </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>list_no</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>codes size list_size * code_size </dd></dl>

<p>Implements <a class="el" href="structfaiss_1_1InvertedLists.html#a60b12f9efe940b617a8380adceef4032">faiss::InvertedLists</a>.</p>

<p>Definition at line <a class="el" href="OnDiskInvertedLists_8cpp_source.html#l00366">366</a> of file <a class="el" href="OnDiskInvertedLists_8cpp_source.html">OnDiskInvertedLists.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ae54e7c6abc10c3d59ea3cd1113466957"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structfaiss_1_1Index.html#a040c6aed1f224f3ea7bf58eebc0c31a4">Index::idx_t</a> * faiss::OnDiskInvertedLists::get_ids </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>list_no</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>ids size list_size </dd></dl>

<p>Implements <a class="el" href="structfaiss_1_1InvertedLists.html#a3ab6b389d8d85c5fbf23889064df7e95">faiss::InvertedLists</a>.</p>

<p>Definition at line <a class="el" href="OnDiskInvertedLists_8cpp_source.html#l00371">371</a> of file <a class="el" href="OnDiskInvertedLists_8cpp_source.html">OnDiskInvertedLists.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aed1cdb979275ec1e6ab8f0c7fead60c7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::OnDiskInvertedLists::prefetch_lists </td>
          <td>(</td>
          <td class="paramtype">const long *&#160;</td>
          <td class="paramname"><em>list_nos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nlist</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>prepare the following lists (default does nothing) a list can be -1 hence the signed long </p>

<p>Reimplemented from <a class="el" href="structfaiss_1_1InvertedLists.html#a4e62994e54a0834f130bb4ba09c16a9c">faiss::InvertedLists</a>.</p>

<p>Definition at line <a class="el" href="OnDiskInvertedLists_8cpp_source.html#l00222">222</a> of file <a class="el" href="OnDiskInvertedLists_8cpp_source.html">OnDiskInvertedLists.cpp</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following files:<ul>
<li>/data/users/matthijs/github_faiss/faiss/<a class="el" href="OnDiskInvertedLists_8h_source.html">OnDiskInvertedLists.h</a></li>
<li>/data/users/matthijs/github_faiss/faiss/<a class="el" href="OnDiskInvertedLists_8cpp_source.html">OnDiskInvertedLists.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
